package net.kansun;

import java.text.SimpleDateFormat
import org.springframework.util.StopWatch/**
 * @author kan.sun
 *
 */

class HelloWord
{
	private static printMap(Map map)
	{
		if(map!=null && map.size()>0)
		{
			println map;
		}
		else
		{
			println "Empty map"
		}
	}
	
	void printMap()
	{
		def printMapClosure = {
			key,value ->
			println key+" = "+value
		}
		
		["M":"Monday", "T":"Tuesday"].each(printMapClosure)
	}
	
	static void main(args)
	{
		//implement interface
		def readable = {it.put("12 34".reverse());5} as Readable
		def s = new Scanner(readable);
		println s.nextInt();
		
		//use closure
		new HelloWord().printMap();
	}
}